Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the rest of V2 factories and interfaces #626

Conversation

tigrannajaryan
Copy link
Member

  • Added V2 metric factories and interfaces for receivers and exporters.
  • Added V2 factories and interfaces for processors.

All changes are uniform with previously introduced initial batch of
V2 factories and interfaces.

Issue: #478

@codecov-io
Copy link

codecov-io commented Mar 12, 2020

Codecov Report

Merging #626 into master will increase coverage by 0.00%.
The diff coverage is 66.66%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #626   +/-   ##
=======================================
  Coverage   74.63%   74.64%           
=======================================
  Files         145      145           
  Lines       10208    10209    +1     
=======================================
+ Hits         7619     7620    +1     
  Misses       2223     2223           
  Partials      366      366           
Impacted Files Coverage Δ
exporter/factory.go 100.00% <ø> (ø)
extension/factory.go 100.00% <ø> (ø)
processor/factory.go 100.00% <ø> (ø)
receiver/factory.go 100.00% <ø> (ø)
service/builder/receivers_builder.go 78.83% <66.66%> (+0.15%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b9dc8ec...763713b. Read the comment docs.

consumer/consumer.go Outdated Show resolved Hide resolved
processor/factory.go Outdated Show resolved Hide resolved
receiver/factory.go Outdated Show resolved Hide resolved
processor/factory.go Outdated Show resolved Hide resolved
@tigrannajaryan tigrannajaryan force-pushed the feature/tigran/factory2-metric branch 2 times, most recently from 6192018 to d797833 Compare March 16, 2020 14:05
- Added V2 metric factories and interfaces for receivers and exporters.
- Added V2 factories and interfaces for processors.
- Creation methods in V2 factories accept a CreationParams struct to
  allow for easier addition of new parameters in the future without
  breaking the interface.

All changes are uniform with previously introduced initial batch of
V2 factories and interfaces (except introduction of CreationParams).

Issue: open-telemetry#478
@@ -56,9 +64,12 @@ type FactoryV2 interface {
// CreateTraceReceiverV2 creates a trace receiver based on this config.
// If the receiver type does not support tracing or if the config is not valid
// error will be returned instead.
CreateTraceExporterV2(logger *zap.Logger, cfg configmodels.Exporter) (TraceExporterV2, error)
CreateTraceExporterV2(ctx context.Context, params CreationParams, cfg configmodels.Exporter) (TraceExporterV2, error)
Copy link
Contributor

@jrcamp jrcamp Mar 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this didn't occur to me until just now. Do we need V2 in these names like CreateTraceExporterV2? Since the type signatures are different I think that is enough to distinguish Factory and FactoryV2 by keeping CreateTraceExporter with just different parameters. From some quick testing this seems to work.

If for some reason we want components to be explicit about their version we could have the factory have a Version() method but doesn't look like that's needed yet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case it will make impossible for a factory to implement both interfaces, which may be desirable during transition period. Let me think a bit.

Side note: I cannot find the relevant part of Golang spec that describes interface method matching and thus making what you propose compliant with the spec - do you know where is it formally defined?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest that we merge as is to avoid more delays and I will look into this separately.

Copy link
Contributor

@pjanotti pjanotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tigrannajaryan
Copy link
Member Author

Merging as is. I will look into renaming some functions additionally.

@tigrannajaryan tigrannajaryan merged commit 98973e7 into open-telemetry:master Mar 16, 2020
@tigrannajaryan tigrannajaryan deleted the feature/tigran/factory2-metric branch March 16, 2020 19:50
MovieStoreGuy pushed a commit to atlassian-forks/opentelemetry-collector that referenced this pull request Nov 11, 2021
* Add check to sum transform for unknown NumberKind

* Initial batching

* Move CheckpointSet transform to internal package

* Add tests for the Exporter Export method

Check batching and general output exporter ResourceMetrics are correct.

* Check errors in tests

* Apply suggestions from code review

Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>

* Use var instead of multiple calls for group IDs

* Fix otlp metric test reporting

Co-authored-by: Krzesimir Nowak <qdlacz@gmail.com>
hughesjj pushed a commit to hughesjj/opentelemetry-collector that referenced this pull request Apr 27, 2023
…y#626)

Bumps [boto3](https://github.com/boto/boto3) from 1.18.20 to 1.18.21.
- [Release notes](https://github.com/boto/boto3/releases)
- [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst)
- [Commits](boto/boto3@1.18.20...1.18.21)

---
updated-dependencies:
- dependency-name: boto3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this pull request Jul 5, 2024
swiatekm pushed a commit to swiatekm/opentelemetry-collector that referenced this pull request Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants